package com.yfq.springframework.beans.factory;

import com.yfq.springframework.beans.config.BeanPostProcessor;
import com.yfq.springframework.beans.config.SingletonBeanRegistry;
import com.yfq.springframework.util.StringValueResolver;

/**
 * @author 姚凤桥
 * @date 2023/1/28 21:18
 * @description
 */
public interface ConfigurableBeanFactory extends SingletonBeanRegistry, HierarchicalBeanFactory {
    String SCOPE_SINGLETON = "singleton";

    String SCOPE_PROTOTYPE = "prototype";

    void addBeanPostProcessor(BeanPostProcessor beanPostProcessor);

    /**
     * 销毁单例对象
     */
    void destroySingletons();

    /**
     * 向BeanFactory中添加StringValueResolver，供解析@Value来使用
     *
     * @param resolver 字符串值解析器
     */
    void addEmbeddedValueResolver(StringValueResolver resolver);

    /**
     * 解析字符串，返回对应的值
     *
     * @param strVal
     */
    String resolveEmbeddedValue(String strVal);
}
